import java.util.Arrays;
import java.util.Stack;

public class test {


    public static void main(String[] args) {
        int[] arr = {1, 2, 3, 4};
        rever(arr);
        System.out.println(Arrays.toString(arr));
    }


    public static void rever(int[] arr) {
        int left = 0;
        int right = arr.length - 1 ;
        while (left < right) {
            int p = 0;
            p = arr[left];
            arr[left] = arr[right];
            arr[right] = p;
            left++;
            right--;
        }
    }
}
